package com.woniu.his.bms.client;

import com.woniu.his.bms.client.result.BillRecordResult;
import com.woniu.his.bms.client.result.BmsInvoiceResult;
import com.woniu.his.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;

/**
 * 发票管理
 */
@FeignClient(contextId = "InvoiceExpClient", name = "bms", path = "bms")
public interface InvoiceRecordClient {


    /**
     * 描述：发票补打 输入新发票号 和  账单id (重打最近的一张发票,上一张可能多种原因开错了）
     */
    @GetMapping("/supplementPrintInvoice")
    Result supplementPrintInvoice(@RequestParam("newInvoiceNo") Long newInvoiceNo,
                                  @RequestParam("billId") Long caseHistoryId);


    /**
     * 描述：发票重打
     */
    @GetMapping("/reprintInvoice")
    Result reprintInvoice(@RequestParam("newInvoiceNo")Long newInvoiceNo,
                          @RequestParam("oldInvoiceNo")Long oldInvoiceNo);


    /**
     * 描述：根据新的start_datetime和end_datetime和收费员id，查询发票信息
     */
    @GetMapping("/queryInvoice")
    Result<List<BmsInvoiceResult>> queryInvoiceInfo(@RequestParam("cashierId") Long cashierId,
                                                    @RequestParam("startDatetime")@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
                                                            Date startDatetime,
                                                    @RequestParam("endDatetime") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
                                                            Date endDatetime);


    /**
     * 描述：根据日结记录id查询发票
     */
    @GetMapping("/queryInvoiceInfoBySettleId")
    Result<List<BmsInvoiceResult>> queryInvoiceInfoBySettleId( @RequestParam("settleRecordId")Long settleRecordId);
}
